<template>
	<!-- 所有医生收藏 -->
	<view>
		<view class="sc">全部收藏</view>
		<view class="container" v-for="item in doctor">
			<view class="botsny">
				<!-- <image class="logo-img" :src="login ? uerInfo.avatarUrl :avatarUrl"></image> -->
				<image class="logo-img" :src="item.doctorPto"></image>
				<view class="box">
					<view>
						<view view class="leftys" @click="ysxi(item.doctorId)">
							&ensp;&ensp;&ensp;{{item.doctorName}}&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
							{{item.doctorVariety==0 ?'兽医':'农医'}}
						</view>
					</view>
					<view>
						<view class="yiyuan">{{item.hospitalName}}</view>
					</view>
					<view>
						<view class="wzl">
							{{item.browse}}&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;32min&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;7.2km
						</view>
					</view>
					<view>
						<view class="wzl1">问诊量&ensp;&ensp;&ensp;平均回复时间&ensp;&ensp;&ensp;距离</view>
					</view>
					<view>
						<button class="button-yuanjiao" @click="zxzx()">在线咨询</button>
						<button class="button-yuanjiao">电话咨询</button>
					</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '找医生',
				show: false,
				login: false,
				avatarUrl: "../../static/uni-center/logo.png",
				doctor: {},
				list: {},
				sexText: ['兽医', '农医'],
			}
		},
		// 预加载
		created() {
			
		},
		onLoad:function(option) {
			this.list=option.customerId	
			
			uni.request({
				url:'http://localhost:8099/serviceedu/doctor/findDoct/'+this.list,
				method:'GET',
				success:(res)=>{
					console.log(res.data.data.list)
					this.doctor = res.data.data.list
				}
			})
		},
		methods: {
			ysxi(doctorId){
				uni.reLaunch({
					url: './doctor?aaa=' + doctorId
				})
				//排行榜医生自增
				uni.request({
					url:'http://localhost:8099/serviceedu/doctor/browse/'+doctorId,
					method:'GET',
					success:(res)=>{
						console.log(res.data.data.count)
					}
				})

			},


			zxzx() {
				uni.reLaunch({
					url: './addpage'
				})
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}

	.container {
		/* 定义容器 */
		display: flex;
		/* 设置容器排列方向 */
		flex-direction: column;
		height: 100%;
		justify-content: space-around;
	}

	.botsny {
		/* background-color: blue; */
		height: 150px;

		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		justify-content: flex-start;
		margin-bottom: 10rpx;
		border: 1upx solid #7e7e7e;
	}

	.logo-img {
		width: 150upx;
		height: 150upx;
		border-radius: 150upx;
		left: 20px;
		top: 20px;
	}

	.box {
		border: lupx solid #333333;
		height: 50%;
		width: 70%;
		display: flex;
		flex-direction: column;
		margin-top: 30rpx;
		margin-left: 70rpx;
	}

	.box>view {
		color: #000000;
		font-weight: bold;
		font-size: 30upx;
		flex: 1;
		height: 100upx;
		display: flex;
		border: 1upx solid #FFFFFF;
		align-items: center;
		/* justify-content: center; */
	}

	.button-yuanjiao {
		width: 170rpx;
		height: 50rpx;
		display: flex;
		margin-top: 30rpx;
		line-height: 50rpx;
		/* justify-content: center; */
		border-radius: 25px;
		background-color: #8bcbaf;
		font-size: 28rpx;
		color: #ffffff;
	}

	.leftys {
		font-size: 30upx;
		border-radius: 150upx;
		left: 100px;
		top: 30px;
		/* position: absolute; */
	}

	.yiyuan {
		font-size: 20upx;
		border-radius: 150upx;
		color: #8bcbaf;
		left: 100px;
		top: 55px;
		/* position: absolute; */
	}

	.wzl {
		font-size: 20upx;
		border-radius: 150upx;
		color: #0a7e0a;
		left: 100px;
		top: 70px;
		/* position: absolute; */
	}

	.wzl1 {
		font-size: 20upx;
		border-radius: 150upx;
		left: 100px;
		top: 85px;
		/* position: absolute; */
	}

	.zx {
		font-size: 20upx;
		border-radius: 150upx;
		left: 150px;
		top: 105px;
		/* position: absolute; */
		color: #0a7e0a;
	}
	
	.sc{
		background-color: #8bcbaf;
		margin-bottom: 10px;
		font-size: 30px;
		text-align: center;
		border-bottom-left-radius: 20px;
		border-bottom-right-radius: 20px;
	}
</style>
